Skip to content

feat: Improve shared media - #2751

Merged
Ivansss merged 10 commits into
mainfrom
feat/noid/improve-shared-media
Oct 14, 2026
Merged

Ivansss merged 10 commits into
mainfrom
feat/noid/improve-shared-media

Conversation

@SystemKeeper

Copy link
Copy Markdown
Collaborator
  • Have a masonry/waterfall design
  • Rework cells and section of all item types
  • Use chips for navigating the shared view
  • Ensure ordering of item types is always the same
Bildschirmfoto 2026-10-08 um 22 44 30

馃 AI (if applicable)

  • The content of this PR was partly or fully generated using AI (N/A)

@SystemKeeper
SystemKeeper requested a review from Ivansss October 8, 2026 20:46

@Ivansss Ivansss left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two issues from the new pagination:

Empty first page stops loading

If every item on the first page is filtered out (unshared files), nothing is appended, and loadMoreItemsIfNearBottom returns early because the list is still empty:

guard self.hasMore, !self.isLoading, !self.currentItems.isEmpty else { return }

The user then sees "No shared items" while hasMore is still true. On main, the "Show more" button was based on the unfiltered count, so this didn't happen.
Maybe we could drop !self.currentItems.isEmpty from the guard? isLoading should already prevent duplicate requests.

Media viewer can stop at the end of the loaded items

mediaViewerMessage(before:) starts loading the next page but returns nil while that load is still running:

if self.currentItems.count - index <= Self.mediaViewerPrefetchDistance {
    self.loadMoreItems()
}

return self.currentItems[(index + 1)...].first(where: { NCMediaViewerViewController.canShowMedia(of: $0) })

UIPageViewController takes the nil as the end and doesn't ask again once the items arrive, so swiping fast through a long history gets stuck until you swipe back and forth.
Maybe we could refresh the viewer's adjacent pages after appendItems (resetting its current page via setViewControllers)?

Apart from that, the rest of the PR looks awesome :)

Assisted-by: ClaudeCode:claude-opus-5.5
Signed-off-by: Marcel M眉ller <marcel-mueller@gmx.de>
Assisted-by: ClaudeCode:claude-opus-5.5
Signed-off-by: Marcel M眉ller <marcel-mueller@gmx.de>
Assisted-by: ClaudeCode:claude-opus-5.5
Signed-off-by: Marcel M眉ller <marcel-mueller@gmx.de>
Assisted-by: ClaudeCode:claude-opus-5.5
Signed-off-by: Marcel M眉ller <marcel-mueller@gmx.de>
Assisted-by: ClaudeCode:claude-opus-5.5
Signed-off-by: Marcel M眉ller <marcel-mueller@gmx.de>
Assisted-by: ClaudeCode:claude-opus-5.5
Signed-off-by: Marcel M眉ller <marcel-mueller@gmx.de>
Assisted-by: ClaudeCode:claude-opus-5.5
Signed-off-by: Marcel M眉ller <marcel-mueller@gmx.de>
Assisted-by: ClaudeCode:claude-opus-5.5
Signed-off-by: Marcel M眉ller <marcel-mueller@gmx.de>
Assisted-by: ClaudeCode:claude-opus-5.5
Signed-off-by: Marcel M眉ller <marcel-mueller@gmx.de>
Assisted-by: ClaudeCode:claude-opus-5.5
Signed-off-by: Marcel M眉ller <marcel-mueller@gmx.de>
@SystemKeeper
SystemKeeper force-pushed the feat/noid/improve-shared-media branch from ab44c7a to 2f84db7 Compare October 14, 2026 12:38
@SystemKeeper

Copy link
Copy Markdown
Collaborator Author

Adjusted and added some more fixes ;)

@SystemKeeper
SystemKeeper requested a review from Ivansss October 14, 2026 12:40
@Ivansss
Ivansss merged commit a94843a into main Oct 14, 2026
10 checks passed
@Ivansss
Ivansss deleted the feat/noid/improve-shared-media branch October 14, 2026 14:34
@Ivansss Ivansss mentioned this pull request Oct 15, 2026
1 task done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants